/*
 * ErrorAst.cpp
 *
 *  Created on: 5 Nov 2010
 *      Author: kn308
 */

#include <MAlice/Parser/location.hh>
#include <MAlice/Ast/ErrorAst.h>

namespace MAlice
{

ErrorAst::ErrorAst(location loc, const string& message) : ExpressionAst(loc),
	mMessage(message)
{
	MALICE_TRACE;
}

ErrorAst::~ErrorAst()
{
	MALICE_TRACE;
}

inline const string& ErrorAst::getMessage() const
{
	MALICE_TRACE;
	return mMessage;
}

llvm::Value* ErrorAst::generate()
{
	MALICE_TRACE;
	throw runtime_error(string("Error AST: ") + getMessage());
}

} // namespace MAlice
